OpenCV in Unreal Engine 5 |
您所在的位置:网站首页 › ue4 opencvplayer截图 › OpenCV in Unreal Engine 5 |
Hi, I have been using OpenCV within Unreal Engine C++ scripts following this integration method. Today I downloaded UE5 and sadly it is not working. I used following C++ actor for testing: TestActor.h #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "opencv2/core.hpp" #include #include #include "Log.h" #include "Misc/Paths.h" #include "TestActor.generated.h" UCLASS() class ATestActor : public AActor { GENERATED_BODY() public: void TestOpenCV(); public: ATestActor(); virtual void BeginPlay() override; };TestActor.cpp #include "TestActor.h" ATestActor::ATestActor(){ //TestOpenCV(); } void ATestActor::TestOpenCV(){ FString RelativePath = FPaths::ProjectDir(); FString FullPath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*RelativePath); std::string path(TCHAR_TO_UTF8(*FullPath)); UE_LOG(LogEndoVRCore, Log, TEXT("Testing OpenCV...")); cv::Mat img = cv::imread(path+"ThirdParty/Data/Lenna.png", cv::IMREAD_COLOR); cv::imshow("Display window", img); cv::waitKey(0); // Wait for a keystroke in the window } void ATestActor::BeginPlay(){ Super::BeginPlay(); TestOpenCV(); }UE5 is running UE_LOG(LogEndoVRCore, Log, TEXT(“Testing OpenCV…”)); but then it is stuck. |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |